﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Simple.Tools;

namespace Simple.Web.Core.Controllers
{
	/// <summary>
	/// 
	/// </summary>
	[Route("api/test-log")]
	[ApiController]
	[AllowAnonymous]
	public class TestLogController : ControllerBase
	{
		/// <summary>
		/// 
		/// </summary>
		[Autowired]
		public ILogger<TestTraController> logger { get; set; }
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		[HttpGet("info")]
		public async Task TestInfo()
		{
			logger.LogInformation("info");
		}
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		[HttpGet("warnning")]
		public async Task TestWarnning()
		{
			int i = 0;
			i=i / i;
			logger.LogWarning("warnning");
		}
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		[HttpGet("Error")]
		public async Task TestError()
		{
			logger.LogError("Error");
		}
	}
}
